<template>
  <div class="div">
      <Yemei></Yemei>
      <h1>欢迎来到智能问答</h1>
      <h2>小i：{{daan}}</h2>
      <el-input v-model="form.question" placeholder="请输入回答"></el-input> 
        <el-button type="primary" round @click="chaxu()">发送</el-button>
  </div>
</template>

<script>
import Yemei from"../components/Yemei.vue"
import {userListb} from '../request/api'
export default {
      components: {
    Yemei
  },data(){
      return{
          daan:"摩西摩西，你好呀~ 我叫小i，你叫什么呢？",
          form:{
              appkey:'94c263ad5bdebbed',
              question:''
          }
      }
      
  },methods:{
    chaxu(){
        if(this.form.question){
             userListb(this.form).then(res=>{
            this.daan = res.data.result.content
            console.log(res)
        })
        }else{
            this.daan="不能发送空白信息哦！！"
        }
       
    }
  }
}
</script>

<style>
    .div{
        text-align: center;
    }

</style>